#include <iostream>

using namespace std;

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		string n;
		cin>>n;
		if(n.back()=='0')
		{
			cout<<'E'<<endl;
		}
		else{
			cout<<'B'<<endl;
			
		}
	}
	return 0;
}
